#include "unique.hpp"
#include "shared.hpp"
using namespace cr_unique;
using namespace cr_shared;

struct mydel
{
    void operator()(int *ptr)
    {
        delete[] ptr;
        ptr = nullptr;
    }
};
int main()
{
    unique_ptr<int> tmp(new int(5));
    unique_ptr<int, mydel> tmpp(new int[5]{1, 2, 3, 4, 5});
    // unique_ptr<int> tmpp = std::make_unique<int>(6);
    std::cout << *tmp << std::endl;
    std::cout << *tmpp << std::endl;

    shared_ptr<int> pptr(new int(1));
    shared_ptr<int, mydel> ptr(new int[5]{1, 2, 3, 4, 5});
    shared_ptr<int, mydel> ptr1 = ptr;
    shared_ptr<int, mydel> ptr2 = ptr1;
    shared_ptr<int, mydel> ptr3;
    ptr3 = ptr;

    ptr=std::move(ptr1);

    return 0;
}